// components/custom-seckill-swiper/index.js
Component({
    /**
     * 组件的属性列表
     */
    properties: {
        swiperList: {
            type: Array,
            value: []
        },
        indicatorDots: {
            type: Boolean,
            value: true
        },
        autoplay: {
            type: Boolean,
            value: true
        },
        interval: {
            type: Number,
            value: 2000
        },
        duration: {
            type: Number,
            value: 500
        },
    },

    /**
     * 组件的初始数据
     */
    data: {
        saleGoodsList: [],
        indicatorDots: true,
        autoplay: true,
        interval: 5000,
        duration: 500,
        currentIndex: 0
    },

    /**
     * 组件的方法列表
     */
    methods: {
        bindchange(e) {
            this.setData({ currentIndex: e.detail.current });
            this.triggerEvent('onChange', e.detail.current)
        },
        onCustomDotTap: function(e) {
            const index = e.currentTarget.dataset.index;
            this.setData({ currentIndex: index });
          },
    }
})